#pragma once

#include <QObject>
#include <QThread>

class DataProcessor : public QObject
{
    Q_OBJECT
public:
    explicit DataProcessor(QObject *parent = nullptr);
    ~DataProcessor() override;

    void start();    // 启动线程
    void stop();     // 停止线程

signals:
    void dataReceived(const QByteArray &data);

public slots:
    void Process(); //工作槽函数，在线程中运行

private:
    QThread workerThread;
    bool running;
};
